package behavior.strategy;

/**
 * @author dali
 * @date 2021-07-29 10:49
 * @Description 单车
 */

public class ByBicycle implements Strategy{
    private final static int Bicycle_FEE = 2;
    //每5公里2块，不满5公里按5公里计费
    @Override
    public int calFee(int distance) {
        return distance % 5 == 0 ?  distance/5*Bicycle_FEE :(distance/5 + 1) * Bicycle_FEE;
    }
}
